/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Lang;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.itttq.gshop.domain.po.OrderOpLogsPo;
import com.itttq.gshop.pbpm.cmpt.mybatis.CustomInLanguage;
import com.itttq.gshop.pbpm.provider.OrderOpLogsSqlProvider;

@Mapper
public interface IOrderOpLogsMapper {

	/**
	 * 根据订单ID查询此订单的所有状态变化信息
	 * 
	 * @param orderId	订单ID
	 * @Author 迷蝶
	 * @return List<OrderWarePo>
	 */
	@Select("SELECT * FROM order_op_logs WHERE order_id = #{orderId} order by create_time desc ")
	public List<OrderOpLogsPo> findOrderOpLogsByOrderId(@Param("orderId") Integer orderId);
	
	/**
	 * 新增OrderOpLogsPo对象
	 * 
	 * @param OrderOpLogsPo
	 * @Author 迷蝶
	 * @return Integer
	 */
	@InsertProvider(type=OrderOpLogsSqlProvider.class,  method="addOrderOpLogs") 
	public Integer addOrderOpLogs(OrderOpLogsPo orderOpLogs);

	/**
	 * 更新OrderOpLogsPo对象
	 * 
	 * @param orderOpLogsPo
	 * @Author 迷蝶
	 * @return Integer
	 */
	@UpdateProvider(type=OrderOpLogsSqlProvider.class,  method="updateOrderOpLogs") 
	public Integer updateOrderOpLogs(OrderOpLogsPo orderOpLogs);
	
	/**
	 * 根据ID删除OrderOpLogsPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 * @return Integer
	 */
	@DeleteProvider(type=OrderOpLogsSqlProvider.class,  method="delOrderOpLogs") 
	public Integer delOrderOpLogsById(Integer id);

	/**
	 * 根据IDS删除OrderOpLogsPo对象
	 * 
	 * @param ids
	 * @Author 迷蝶
	 * @return List<OrderOpLogsPo>
	 */
	@Lang(CustomInLanguage.class)
	@Delete("DELETE FROM order_info WHERE id IN (#{ids})")
	public Integer delOrderOpLogsByIds(@Param("ids") List<Integer> ids);
	
	/**
	 * 根据条件查找OrderOpLogsPo对象，默认根据ID降序
	 * 
	 * @param orderOpLogsPo
	 * @Author 迷蝶
	 * @return List<OrderOpLogsPo>
	 */
	@SelectProvider(type=OrderOpLogsSqlProvider.class,  method="findOrderOpLogss") 
	public List<OrderOpLogsPo> findOrderOpLogss(OrderOpLogsPo orderOpLogs);
	
	/**
	 * 根据条件查找记录总数
	 * 
	 * @param orderOpLogsPo
	 * @Author 迷蝶
	 * @return Integer
	 */
	@SelectProvider(type=OrderOpLogsSqlProvider.class,  method="findOrderOpLogsCount") 
	public Integer findOrderOpLogsCount(OrderOpLogsPo orderOpLogs);
	
	/**
	 * 根据ID查找OrderOpLogsPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 * @return OrderOpLogsPo
	 */
	@SelectProvider(type=OrderOpLogsSqlProvider.class,  method="findOrderOpLogsById") 
	public OrderOpLogsPo findOrderOpLogsById(Integer id);

	/**
	 * 根据ID查找OrderOpLogsPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 * @return OrderOpLogsPo
	 */
	@SelectProvider(type=OrderOpLogsSqlProvider.class,  method="insertBatch") 
	public Integer insertBatch(final Map<String, List<OrderOpLogsPo>> map);
	
}